﻿
using Axis.Web.Administrator.Global;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Axis.BusinessObject.Core;

namespace Axis.Web.Master
{
    public partial class Web : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            CMemberList member = new CMemberList();
            if (Session["MEMBERINFO"] != null)
                member = Session["MEMBERINFO"] as CMemberList;
            StringBuilder ret = new StringBuilder();
            ret.Append("var _SYS_GLOBAL={");
            ret.Append("MEMBER:{");
            ret.AppendFormat("ID:'{0}'", member.ID==0?0:-1);
            ret.Append("},");
            ret.Append("DATE:{");
            ret.AppendFormat("TODAY:'{0}',", DateTime.Now.ToString("dd/MM/yyyy"));
            ret.AppendFormat("YEAR:'{0}',", DateTime.Now.Year);
            ret.AppendFormat("MONTH:'{0}',", DateTime.Now.Month);
            ret.AppendFormat("DAY:'{0}'", DateTime.Now.Day);
            ret.Append("}");
            ret.Append("};");

            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Global_Variable", ret.ToString(), true);
        }
    }
}